<template>
  <div>
  <div>
    <div v-text="msg" ref="title"></div>
    <button @click="showDOM" ref="but">点我显示上方的Dom</button>
  </div>
  <School-n ref="sch"/>
  </div>
</template>

<script>
 import SchoolN from './components/School.vue'
export default {
  name:'App',
  components:{SchoolN},
  data() {
    return {
      msg:'欢迎学习vue'
    }
  },
  methods:{
    showDOM(){
      console.log(this.$refs.title)//div标签
      console.log(this.$refs.but)//button标签
      console.log(this.$refs.sch)//组件sch
    }
  }
}
</script>
